<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="robots" content="all,follow">
    <script src="setting.js"></script>
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
    <!-- Fontastic Custom icon font-->
    <link rel="stylesheet" href="css/fontastic.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="css/custom.css">
    <!-- Favicon-->
    <link rel="shortcut icon" href="img/favicon.ico">
    <!-- Tweaks for older IEs--><!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
  </head>
  <body>
    <div class="page login-page">
      <div class="container d-flex align-items-center">
        <div class="form-holder has-shadow">
          <div class="row">
            <!-- Logo & Information Panel-->
            <div class="col-lg-6">
              <div class="info d-flex align-items-center">
                <div class="content">
                  <div class="logo">
                    <h1>公司</h1>
                  </div>
                  <p>NGXDB</p>
                </div>
              </div>
            </div>
            <!-- Form Panel    -->
            <div class="col-lg-6 bg-white">
              <div class="form d-flex align-items-center">
                <div class="content">
                   <div class="form-group">
                      <label for="login-username" class="label-material control-label">用户帐号</label>
                      <input id="login-username" type="text" name="loginUsername" required data-msg="请输入登录帐号" class="form-control">
                    </div>
                    <div class="form-group">
                      <label for="login-password" class="label-material control-label">密码</label>
                      <input id="login-password" type="password" name="loginPassword" required data-msg="请输入密码" class="form-control">
                    </div>
                                           <div class="form-group">
                                                <label  >
                                                    <input type="checkbox" class="checkbox-template control-label" id="ckb_savename">
                                                    <span class="lbl">记住用户名</span></label>
					<a id="login" class="btn btn-primary form-control">登录</a>
                                                
					</div>
                    <!-- This should be submit button but I replaced it with <a> for demo purposes-->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="copyrights text-center">
        <p>Design by <a href="#" class="external">Liuzushi</a>
          <!-- Please do not remove the backlink to us unless you support further theme's development at https://bootstrapious.com/donate. It is part of the license conditions. Thank you for understanding :)-->
        </p>
      </div>
    </div>
    <!-- JavaScript files-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/popper.js/umd/popper.min.js"> </script>
    <script src="vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="vendor/jquery.cookie/jquery.cookie.js"> </script>
    <script src="vendor/chart.js/Chart.min.js"></script>
    <script src="vendor/jquery-validation/jquery.validate.min.js"></script>
    <!-- Main File-->
    <script src="js/front.js"></script>
  </body>
</html>

<script>

$(function(){
	$("#login").click(function(){
		
		if ($("#login-username").val=="") {$("#login-username").focus();return false};
		if ($("#login-password").val=="") {$("#login-password").focus();return false};
        $.ajax({
			type:"POST",
			url:url+'sysinfo/login',
			data:{"loginname":$("#login-username").val(),"pass":$("#login-password").val(),"system":systemid},
			dataType:"JSON",
			beforeSend:function(){$("#login").html("正在登录...");},
			success:function(data){
				$("#login").html("登录")
				if (data.errorcode==0){	
					var actions=new Array();
          if(data.info.actions!=null){
            for(var i=0,len=data.info.actions.length;i<len;i++){
                            actions[i]=data.info.actions[i]
                        };
                    }
                    localStorage.clear();
                    console.log(data.info.operator)
                    localStorage.actions=actions;
                    localStorage.token=data.info.token;
                    localStorage.operator=JSON.stringify(data.info.operator);
                    window.location.href="index.html";
        }else{
          alert(data["message"]);
        }
      },
			error:function(msg){
                console.log(msg);
            }
        });
		
		
	});
	
});

    $(document).keydown(function(event){ 
		if(event.keyCode == 13){ //绑定回车 
        $('#login').click();
		} 	
	}); 




</script>